<?php
include 'config.php';

// 创建公告表
$sql_notices = "CREATE TABLE IF NOT EXISTS notices (
    id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    notice_text TEXT NOT NULL
)";

if ($conn->query($sql_notices) !== TRUE) {
    echo "创建公告表时出错: " . $conn->error;
}

// 创建轮播图表
$sql_slides = "CREATE TABLE IF NOT EXISTS slides (
    id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    image_url VARCHAR(255) NOT NULL
)";

if ($conn->query($sql_slides) !== TRUE) {
    echo "创建轮播图表时出错: " . $conn->error;
}

// 创建按钮表
$sql_buttons = "CREATE TABLE IF NOT EXISTS buttons (
    id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    button_text VARCHAR(255) NOT NULL,
    link_url VARCHAR(255) NOT NULL,
    icon_path VARCHAR(255) DEFAULT NULL
)";

if ($conn->query($sql_buttons) !== TRUE) {
    echo "创建按钮表时出错: " . $conn->error;
}

$conn->close();
?>    